<!doctype html>{% load staticfiles i18n news_tags components comments_tags accounts_tags videos_tags %}
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en" dir="ltr"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en" dir="ltr"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="en" dir="ltr"><!--<![endif]-->
<head>
    <title>{% block title %}Django на русском{% endblock %}</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="Content-Language" content="ru"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="ROBOTS" content="ALL"/>
    <meta name="keywords" content="Python, Django, framework, open-source, Питон, Джанго"/>
    <meta name="description" content="{% block description %}{% endblock %}"/>
    <meta name="generator" content="Django"/>
    <meta name="google-site-verification" content="zICpUlONvVLohGcE1oztBD1-qHqkAOuS-Oaim8NFW2s" />
    <meta name="yandex-verification" content="6d1a4f7f8e899361" />
    <meta property="og:site_name" content="DjangoBook v2.0"/>
    <meta property="og:image" content="{% static 'img/djangobook-title.png' %}"/>

    <link href="{% url 'news:rss' %}" rel="alternate" type="application/rss+xml" title="{% trans 'The freshest news about Russian version of DjangoBook' %}"/>
    <link href="{% url 'examples:rss' %}" rel="alternate" type="application/rss+xml" title="{% trans 'Newly examples from Russian DjangoBook' %}"/>
    <link href="{% url 'rss' %}" rel="alternate" type="application/rss+xml" title="{% trans 'DjangoBook RSS feed' %}"/>

    <!-- CSS ================ -->
    <link rel="stylesheet" href="{% static 'theme/css/bootstrap.min.css' %}" type="text/css"/>
    <link rel="stylesheet" href="{% static 'theme/css/style.css' %}" type="text/css"/>
    <link rel="stylesheet" href="{% static 'theme/css/header-2.css' %}" type="text/css"/>
    <link rel="stylesheet" href="{% static 'flags/flags.css' %}" type="text/css"/>

    <!-- Icons ================ -->
    <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
    <link rel="apple-touch-icon-precomposed" href="{% static 'img/djangobook-title.png' %}" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{% static 'img/djangobook-title.png' %}" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{% static 'img/djangobook-title.png' %}" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{% static 'img/djangobook-title.png' %}" />
    <link rel="shortcut icon" href="{% static 'img/favicon.ico' %}" />

    <script type="text/javascript" src="{% url 'js_i18n_catalog' %}"></script>
    <script src="{% static 'theme/js/jquery.min.js' %}"></script>

    {% block highlightjs %}
    <link rel="stylesheet" href="//yandex.st/highlightjs/7.3/styles/github.min.css">
    <style>
        pre code {
            background: none;
        }
    </style>
    <script src="//yandex.st/highlightjs/7.3/highlight.min.js"></script>
    <script type="text/javascript">
        jQuery(function($){
            hljs.tabReplace = '    ';
            hljs.initHighlightingOnLoad();
        });
    </script>
    {% endblock %}

    {% block head %}{% endblock %}
    <script type="text/javascript">
      $(document).ready(function() {
          $.ajaxSetup({
              beforeSend: function(xhr, settings) {
                  function getCookie(name) {
                      var cookieValue = null;
                      if (document.cookie && document.cookie != '') {
                          var cookies = document.cookie.split(';');
                          for (var i = 0; i < cookies.length; i++) {
                              var cookie = jQuery.trim(cookies[i]);
                              // Does this cookie string begin with the name we want?
                                  if (cookie.substring(0, name.length + 1) == (name + '=')) {
                                      cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                                      break;
                                  }
                          }
                      }
                      return cookieValue;
                  }
                  if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
                      // Only send the token to relative URLs i.e. locally.
                      xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
                  }
              }
          });
      });
    </script>
</head>
<body class="alternative-header">
    {% now "Y-m-d" as current_date %}
    {% if current_date == '2016-04-01' %}
    <div>
        <pre style="margin: 0; padding: 0;">
        Error: Something unexpected has occurred.
         at main (c:\Users\Me\Documents\djbookru\production.js:9:15)
         at Object. (c:\Users\Me\Documents\djbookru\herak_herak.js:17:1)
         at Module._compile (module.js:460:26)
         at Object.Module._extensions..js (module.js:478:10)
         at Module.load (module.js:355:32)
         at Function.Module._load (module.js:310:12)
         at Function.Module.runMain (module.js:501:10)
         at startup (node.js:129:16)
         at node.js:814:3
         </pre>
    </div>
    {% endif %}
    {% block body %}
    <!-- begin accesibility skip to nav skip content -->
    <ul class="visuallyhidden" id="top">
        <li><a href="#nav" title="Skip to navigation" accesskey="n">{% trans 'Skip to navigation' %}</a></li>
        <li><a href="#page" title="Skip to content" accesskey="c">{% trans 'Skip to content' %}</a></li>
    </ul>
    <!-- end /.visuallyhidden accesibility-->

    <!-- mobile navigation trigger-->
    <h5 class="mobile_nav"><a href="javascript:void(0)">&nbsp;<span></span></a></h5>
    <!--end mobile navigation trigger-->
    <div class="preheader-wrapper">
    <section class="container preheader">

        <!--this is the login for the user-->
        <nav class="user clearfix">
            {% if user.is_authenticated %}
                <a href="{{ user.get_absolute_url }}"><i class="fa fa-user"></i> {{ user.username }}</a>
                <span class="hidden-phone">|</span>
                <a href="{% url 'accounts:logout' %}?next={{ request.path_info|urlencode }}">
                    <i class="fa fa-share"></i> <span class="hidden-phone">{% trans 'Logout' %}</span>
                </a>
            {% else %}
                <a href="{% url 'accounts:login' %}?next={{ request.path_info|urlencode }}"><i class="fa fa-share"></i> {% trans 'Login' %}</a>
            {% endif %}
            {% if user.is_staff and user.is_active %}
                <span class="hidden-phone">|</span> <a href="{% url 'admin:index' %}">
                    <i class="fa fa-cog"></i> <span class="hidden-phone">{% trans "Admin UI" %}</span>
                </a>
            {% endif %}
            <span class="hidden-phone">|</span>
            {% if LANGUAGE_CODE|lower|slice:":2" == "en" %}
                <a href="{% url 'main:lang' 'ru' %}">RU</a>
            {% elif LANGUAGE_CODE|lower|slice:":2" == "ru" %}
                <a href="{% url 'main:lang' 'en' %}">EN</a>
            {% endif %}
        </nav>
        <!--close user nav-->

        <div class="search-wrapper">
            <form class="search" method="get" action="{% url 'main:search' %}">
                <div id="search-trigger">{% trans "Search:" %}</div>
                <input id="search-box" name="q" type="text" placeholder="{% trans 'search + enter' %}">
            </form>
        </div>
        <ul class="social">
            <li>
                <a href="{% url 'rss' %}" data-placement="bottom" title="{% trans 'Subscribe to our RSS' %}"><i class="fa fa-rss fa-lg"></i></a>
            </li>
            <li>
                <a href="https://github.com/djbook-ru/" data-placement="bottom" title="{% trans 'Documentation translation' %}">
                    <i class="fa fa-github-alt fa-lg"></i>
                </a>
            </li>
        </ul>
    </section>
    </div>
    {% block menu %}{% menu %}{% endblock %}

    <!-- begin #page - the container for everything but header -->
    <div id="page">
        {% if messages %}
        <div class="messages container clearfix">
            {% for message in messages %}
                <div class="alert message {% if message.tags %}alert-{{ message.tags }}{% endif %}">
                    {{ message }}
                    <a class="close" data-dismiss="alert" href="#">&times;</a>
                </div>
            {% endfor %}
        </div>
        {% endif %}

        {% block pre_content %}
            {% if user.is_authenticated and not user.is_valid_email %}
            <div class="messages container clearfix">
                <div class="alert alert-error">
                    <h4><a href="{% url 'accounts:edit' %}">{% trans "Confirm you email" %}</a></h4>
                    <p>
                        {% blocktrans %}
                            You account does not have confirmed email.
                            You should edit email if your profile has incorrect one and confirm it.
                        {% endblocktrans %}
                    </p>
                    <p>
                        {% trans "Your current email is:" %} {{ user.email }}<br>
                        <h4><a href="{% url 'accounts:resend_confirmation_email' %}">{% trans "Send confirmation email" %}</a></h4>
                    </p>
                </div>
            </div>
            {% endif %}
            {% announcements %}
        {% endblock %}

        {% block page %}{% endblock %}

        {% block feedback_link %}
            <a class="feedback-link" href="{% url 'main:feedback' %}" target="_blank">{% trans 'Please, write feedback if something does not work' %}</a>
        {% endblock %}

        {% include '_footer.html' %}

        <span class="backToTop"><a href="#top">back to top</a></span>
    </div>
    <!-- close #page-->

    <!-- JS JQuery ================ -->
    {% block scripts %}
    <script src="{% static 'theme/js/bootstrap.min.js' %}"></script><!--transitions, tooltips, popover, buttons, modals, alert messages-->
    <script src="{% static 'theme/js/modernizr.custom.87724.js' %}"></script>
    <script src="{% static 'theme/js/ddsmoothmenu-min.js' %}"></script><!-- desktop edge detect menu -->
    <script src="{% static 'theme/js/jquery.dcjqaccordion.2.7.min.js' %}"></script><!-- mobile multi-level accordion menu -->
    <script src="{% static 'theme/js/jquery.easytabs.min.js' %}"></script><!-- tabs/testimonials -->
    <script src="{% static 'theme/js/slide-to-top-accordion-min.js' %}"></script><!-- slide to top accordion toggle -->
    <script src="{% static 'theme/js/jquery.easing-1.3.min.js' %}"></script><!--easing-->
    <script src="{% static 'theme/js/jquery.flexslider-min.js' %}"></script><!--flexslider content slider twitter slider and initializations-->
    <script src="{% static 'theme/js/responsive-tables.js' %}"></script><!--responsive table-->
    <script src="{% static 'theme/js/jquery.fitvid.js' %}"></script><!-- responsive videos -->
    <script src="{% static 'theme/js/scripts.js' %}"></script>
    <script src="{% static 'js/jquery.form.js' %}"></script>
    <script src="{% static 'js/jquery-spelling.js' %}"></script>
    <script>
        $('[rel="popover"]').popover({
            delay: { show: 500, hide: 100 }
        });
        $('[data-toggle="tooltip"]').tooltip();
    </script>
    {% endblock %}
    {% endblock %}

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-3919032-6']);
    _gaq.push(['_trackPageview']);



    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    <!-- Yandex.Metrika counter -->
    <script type="text/javascript">
    (function (d, w, c) {
        (w[c] = w[c] || []).push(function() {
            try {
                w.yaCounter20399554 = new Ya.Metrika({id:20399554,
                        webvisor:true,
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true});
            } catch(e) { }
        });

        var n = d.getElementsByTagName("script")[0],
            s = d.createElement("script"),
            f = function () { n.parentNode.insertBefore(s, n); };
        s.type = "text/javascript";
        s.async = true;
        s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";

        if (w.opera == "[object Opera]") {
            d.addEventListener("DOMContentLoaded", f, false);
        } else { f(); }
    })(document, window, "yandex_metrika_callbacks");
    </script>
    <noscript><div><img src="//mc.yandex.ru/watch/20399554" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
    <!-- /Yandex.Metrika counter -->
</body>
</html>
